﻿using Calimbra.Runtime.Contracts;

namespace Calimbra.Runtime.Data
{
    public class Message : IMessage
    {
        public Message(string portName, object data)
            :this(new Port(portName), data)
        {
            
        }
        public Message(IPort port, object data)
        {
            Port = port;
            Data = data;
        }

        #region IMessage Members

        public IPort Port { get; private set; }

        public object Data { get; private set; }

        #endregion

        public override string ToString()
        {
            return string.Format("Message(Port='{0}', Data='{1}')", this.Port, this.Data);
        }
    }
}